# -*- coding=utf-8
from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client

secret_id = 'AKIDEH9BwSijV0GJ7gy1Yqrc7PTHEepkTxDE'
secret_key = 'pPkrjLglbCRWR6WgbGgqlY6j8LLAnCNJ'
region = 'ap-nanjing'

config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)
client = CosS3Client(config)

# 创建桶
response = client.create_bucket(
    Bucket='test-1317332932',
    ACL='public-read',  # private / public-read / public-read-write
)

# 上传文件
# response = client.upload_file(
#     Bucket='wodetong-1317332932',
#     LocalFilePath='RandomStr.py',
#     Key='ran_str.py',
# )
#
# print(response['ETag'])
